<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="view/admin/style/basic.css" />
<link rel="stylesheet" type="text/css" href="view/admin/style/order.css" />
<script type="text/javascript" src="view/admin/js/order.js"></script>
<title>Insert title here</title>
</head>
<body>
    <h2><a href="?a=order">返回订单列表</a>订单 -- 修改订单</h2>
    <div id="list">
        <table cellspacing="1">
            <caption>订单信息</caption>
            <tr><th>订单编号</th><th>下单时间</th></tr>
            <tr><td>{$oneOrder[0]->ordernum}</td><td>{$oneOrder[0]->date}</td></tr>
        </table>
        <br /> 
        <table cellspacing="1">
            <caption>商品状态</caption>
            <tr><th>编号</th><th>名称</th><th>属性</th><th>售价</th><th>数量</th><th>小计</th></tr>
            {foreach from=$oneOrder[0]->goods key=key item=value}
            <tr><td>{$value.sn}</td><td>{$value.name}</td><td>
            {foreach from=$value.attr key=k item=v}
                {$k}:
                {foreach from=$v key=k2 item=v2}
                {$v2};
                {/foreach} 
            {/foreach}
            </td><td>{$value.price_sale}</td><td>{$value.num}</td><td style="color:red">{$value.total_small}元</td></tr>
            {/foreach}
        </table>
        <br /> 
        <table cellspacing="1">
            <caption>收货人信息</caption>
            <tr><th>用户名</th><th>收货人</th><th>电子邮件</th></tr>
            <tr><td>{$oneOrder[0]->user}</td><td>{$oneOrder[0]->name}</td><td>{$oneOrder[0]->email}</td></tr>
        </table>
        <br /> 
        <table cellspacing="1">
            <caption>支付信息</caption>
            <tr><th>物流方式</th><th>支付方式</th><th>总金额</th></tr>
            <tr><td>{$oneOrder[0]->delivery}</td><td>{$oneOrder[0]->pay}</td><td style="color:red;">{$oneOrder[0]->price}元</td></tr>
        </table>
        <br />    
        <table cellspacing="1">
            <caption>备注信息</caption>
            <tr><th>备注信息</th><th>缺货处理</th></tr>
            <tr><td>{$oneOrder[0]->text}</td><td>{$oneOrder[0]->ps}</td></tr>
        </table>
        <br /> 
        <table cellspacing="1">
            <caption>送货信息</caption>
            <tr><th>邮政编码</th><th>联系电话</th><th>标志性建筑</th><th>收货地址</th></tr>
            <tr><td>{$oneOrder[0]->zipcode}</td><td>{$oneOrder[0]->phone}</td><td>{$oneOrder[0]->building}</td><td>{$oneOrder[0]->address}</td></tr>
        </table>
    </div>
    <form method="post" name="update" action="?a=order&m=update&id={$oneOrder[0]->id}">
        <dl class="form">
            <input type="hidden" name="user" value="{$oneOrder[0]->user}" />
            {if $oneOrder[0]->order_state == '已取消'}
            <dd>订单状态：<span class="red">已取消，订单失效，可以选择<a href="?a=order&m=delete&id={$smarty.get.id}">[删除]</a>!</dd>
            {else}
                {if $oneOrder[0]->refund == 1}
                <dd style="color:red;">此订单正在处于退款状态，请检查是否符合退款条件，然后点击下面按钮退款!</dd>
                <input type="hidden" name="refund" value="2" />
                <dd class="submit"><input type="submit" name="send" value="确定退款"/><span style="color:red">(确定后，库存将会恢复，该订单也将暂时处于失效状态!)</span></dd>
                {else}
                    {if $oneOrder[0]->refund == 2}
                        <dd style="color:red;">此订单正在处于暂时失效状态，用户可重新下单，如果用户在24小时内不重新下单，则订单将会转为已取消状态!</dd>
                    {else}
            <dd>订单状态：
                {if $oneOrder[0]->order_state != '已确认'}<input type="radio" name="order_state" {if $oneOrder[0]->order_state == '未确认'} checked="checked"{/if} value="未确认"/>未确认{/if}
                <input type="radio" name="order_state" {if $oneOrder[0]->order_state == '已确认'} checked="checked"{/if} value="已确认"/>已确认
                <input type="radio" name="order_state" {if $oneOrder[0]->order_state == '已取消'} checked="checked"{/if} value="已取消"/>已取消
            </dd>
            <dd>支付状态：
                {if $oneOrder[0]->order_pay != '已付款'}<input type="radio" name="order_pay" {if $oneOrder[0]->order_pay == '未付款'} checked="checked"{/if} value="未付款"/>未付款{/if}
                <input type="radio" name="order_pay" {if $oneOrder[0]->order_pay == '已付款'} checked="checked"{/if} value="已付款"/>已付款
            </dd>
            <dd>配送状态：
                {if $oneOrder[0]->order_delivery != '已发货'}
                <input type="radio" name="order_delivery" {if $oneOrder[0]->order_delivery == '未发货'} checked="checked"{/if} value="未发货"/>未发货
                <input type="radio" name="order_delivery" {if $oneOrder[0]->order_delivery == '已配货'} checked="checked"{/if} value="已配货"/>已配货
                {/if}
                <input type="radio" name="order_delivery" {if $oneOrder[0]->order_delivery == '已发货'} checked="checked"{/if} value="已发货"/>已发货
            </dd>
            <dd style="display:none;" class="delivery">物流公司：
                <select onchange="changDelivery();" id="d" name="delivery_name">
                    <option> -- 请选择一个物流公司 -- </option>
                    {foreach from=$allDelivery key=key item=value}
                    {if $oneOrder[0]->delivery_name == $value->name}
                    <option url="{$value->url}" value="{$value->name}" selected="selected">{$value->name}</option>
                    {else}
                    <option url="{$value->url}" value="{$value->name}">{$value->name}</option>
                    {/if}
                    {/foreach}
                </select> <input type="hidden" name="delivery_url" value="{$oneOrder[0]->delivery_url}" />
            </dd>
            <dd style="display:none;" class="delivery">运 单 号： <input type="text" name="delivery_number" value="{$oneOrder[0]->delivery_number}" class="text"/></dd>
            <dd class="submit"><input type="submit" name="send" value="修改订单"/></dd>
                    {/if}
                {/if}
            {/if}
        </dl>
    </form>
</body>
</html>